#include "input_processor.hpp"

Named_sequence get_raw_sequence( ifstream & stream )
{
	Sequence_name name;
	Sequence sequence;
	
	if( stream.get() == '>' )
	{
		stream >> name;
	}
	
	while( !stream.eof() )
	{
		int c = stream.get();
		if( c == '>' )
		{
			stream.unget();
			break;
		}
		else
		{
			sequence.push_back( c );
		}
	}
	
	return make_pair( name, sequence );
}

Named_sequence get_filtered_sequence( ifstream & stream )
{
	Sequence_name name;
	Sequence sequence;

	if( stream.get() == '>' )
	{
		stream >> name;
	}

	while( !stream.eof() )
	{
		int c = stream.get();
		if( c == '>' )
		{
			stream.unget();
			break;
		}
		else if( c == 'A' || c == 'C' || c == 'G' || c == 'T' )
		{
			sequence.push_back( c );
		}
	}

	return make_pair( name, sequence );
}
